﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace BrushVisualizer.Visualizer
{
    /// <summary>
    /// Renders an image on a window
    /// </summary>
    public partial class BrushForm : Form
    {

        /// <summary>
        /// Initializes a new instance of the <see cref="BrushForm"/> class.
        /// </summary>
        /// <param name="imageStream">The stream containing the image to render.</param>
        public BrushForm(System.IO.Stream imageStream)
        {
            InitializeComponent();
            pic.Image = Image.FromStream(imageStream);
        }

        private void sizeModeButtons_CheckedChanged(object sender, EventArgs e)
        {
            var b = (RadioButton)sender;
            if (b.Checked)
                pic.SizeMode = (PictureBoxSizeMode)Enum.Parse(typeof(PictureBoxSizeMode), b.Name.Substring("rdo".Length));
        }
    }
}
